import fetch from '@/utils/fetch'

// *************** 菜单管理 *************** \\

// 新增菜单
export function sysmenu_add(data) {
  return fetch({
    url: '/api/adminMenu/post/addMenu',
    method: 'post',
    data
  })
}
// 查询菜单树
export function sysmenu_list(params) {
  return fetch({
    url: '/api/adminMenu/get/selectMenuTree',
    method: 'get',
    params
  })
}
// 删除菜单
export function sysmenu_delete(params) {
  return fetch({
    url: '/api/adminMenu/delete/deleteMenu',
    method: 'delete',
    params
  })
}
// 修改菜单
export function sysmenu_update(data) {
  return fetch({
    url: '/api/adminMenu/put/updateMenu',
    method: 'put',
    data
  })
}

// *************** 角色管理 *************** \\
// 新增角色
export function sysrole_add(data) {
  return fetch({
    url: '/api/adminRole/post/addRole',
    method: 'post',
    data
  })
}
// 通过 roleId 查询菜单树
export function selectMenuTreeByRoleId(params) {
  return fetch({
    url: '/api/adminRole/get/selectMenuTreeByRoleId',
    method: 'get',
    params
  })
}
// 设置角色菜单
export function setRoleMenu(data) {
  return fetch({
    url: '/api/adminRole/post/setRoleMenu',
    method: 'post',
    data
  })
}
// 角色列表
export function sysrole_allList(params) {
  return fetch({
    url: '/api/adminRole/get/selectRoleList',
    method: 'get',
    params
  })
}
// 角色列表（分页）
export function sysrole_list(params) {
  return fetch({
    url: '/api/adminRole/get/selectRoleVoPage',
    method: 'get',
    params
  })
}
// 删除角色
export function sysrole_delete(params) {
  return fetch({
    url: '/api/adminRole/delete/deleteRole',
    method: 'delete',
    params
  })
}
// 修改角色
export function sysrole_update(data) {
  return fetch({
    url: '/api/adminRole/put/updateRole',
    method: 'put',
    data
  })
}


// *************** 成员管理 *************** \\

export function sysuser_add(data) {
    return fetch({
        url: '/api/adminUser/post/addAdminUser',
        method: 'post',
        data
    })
}

export function sysuser_list(params) {
    return fetch({
        url: '/api/adminUser/get/selectAdminUserVoPage',
        method: 'get',
        params
    })
}
export function sysuser_delete(params) {
    return fetch({
        url: '/api/adminUser/delete/deleteAdminUser',
        method: 'delete',
        params
    })
}
export function sysuser_update(data) {
    return fetch({
        url: '/api/adminUser/put/updateAdminUser',
        method: 'put',
        data
    })
}
export function sysuser_setOpen(data) {
    return fetch({
        url: '/api/adminUser/post/setStatus',
        method: 'post',
        data
    })
}
export function sysuser_resetPassword(data) {
    return fetch({
        url: '/api/adminUser/post/resetPassword',
        method: 'post',
        data
    })
}
export function sysuser_updatePwd(data) {
    return fetch({
        url: '/api/sysuser/updatePwd',
        method: 'put',
        data
    })
}
// 设置商务区域
export function setShangwuRegion(data) {
  return fetch({
    url: '/api/adminUser/post/setShangwuRegion',
    method: 'post',
    data
  })
}
// 查询商务的区域树
export function selectAdminShangwuRegionTree(params) {
  return fetch({
    url: '/api/adminUser/get/selectAdminShangwuRegionTree',
    method: 'get',
    params
  })
}


// 系统日志管理
export function selectAdminLogPage(params) {
  return fetch({
    url: '/api/adminLog/get/selectAdminLogPage',
    method: 'get',
    params
  })
}


// 商品订单
export function erpGoodsOrderSync_batchSync(data) {
    return fetch({
        url: '/api/erpGoodsOrderSync/batchOrderSyncn',
        method: 'post',
        data
    })
}
export function erpGoodsOrderSync_list(params) {
    return fetch({
        url: '/api/erpGoodsOrderSync/getGoodsOrderSyncList',
        method: 'get',
        params
    })
}
export function importGoodsOrderSettle(data) {
    return fetch({
        url: '/api/erpGoodsOrder/importGoodsOrderSettle',
        method: 'post',
        data,
        responseType: 'blob'
    })
}
export function erpGoodsOrder_importTips(data) {
    return fetch({
        url: '/api/erpGoodsOrder/importGoodsOrderTips',
        method: 'post',
        data,
        responseType: 'blob'
    })
}
export function erpGoodsOrder_updateOrderStatus(data) {
    return fetch({
        url: '/api/erpGoodsOrder/updateByOrderStatus',
        method: 'post',
        data
    })
}
export function erpGoods_copyAddGoods(data) {
    return fetch({
        url: '/api/erpGoods/copyAddGoods',
        method: 'post',
        data
    })
}
export function erpGoodsOrder_cancelOrder(data) {
    return fetch({
        url: '/api/erpGoodsOrder/platformCancelGoodsOrder',
        method: 'post',
        data
    })
}
export function erpGoodsOrder_addIssues(data) {
    return fetch({
        url: '/api/erpGoodsOrder/addIssues',
        method: 'post',
        data
    })
}
export function erpGoodsOrder_transferOrder(data) {
    return fetch({
        url: '/api/erpGoodsOrder/transferOrder',
        method: 'post',
        data
    })
}
export function erpGoodsOrder_list(params) {
    return fetch({
        url: '/api/erpGoodsOrder/getGoodsOrderList',
        method: 'get',
        params
    })
}
export function choiceBusiness(params) {
    return fetch({
        url: '/api/erpGoodsOrder/choiceBusiness',
        method: 'get',
        params
    })
}
export function erpGoodsOrder_info(params) {
    return fetch({
        url: '/api/erpGoodsOrder/info',
        method: 'get',
        params
    })
}
export function erpGoodsOrder_ordeTrack(params) {
    return fetch({
        url: '/api/erpGoodsOrder/getOrdeTrackByKd',
        method: 'get',
        params
    })
}
export function erpGoodsOrder_export(params) {
    return fetch({
        url: '/api/erpGoodsOrder/export',
        method: 'get',
        params,
        responseType: 'blob'
    })
}

// 品牌审核
export function erpGoodsBrandAudit_list(params) {
    return fetch({
        url: '/api/erpGoodsBrandAudit/list',
        method: 'get',
        params
    })
}
export function erpGoodsBrandAudit_batchAudit(data) {
    return fetch({
        url: '/api/erpGoodsBrandAudit/batchAudit',
        method: 'post',
        data
    })
}
export function selectChannelNoPermissionList(params) {
    return fetch({
        url: '/api/sysuser/selectChannelNoPermissionList',
        method: 'get',
        params
    })
}


// 订单审核
export function erpGoodsOrder_addTips(data) {
    return fetch({
        url: '/api/erpGoodsOrder/addTips',
        method: 'post',
        data
    })
}
export function orderAudit_list(params) {
    return fetch({
        url: '/api/erpGoodsOrderAuditController/getGoodsOrderList',
        method: 'get',
        params
    })
}
export function orderAudit_info(params) {
    return fetch({
        url: '/api/erpGoodsOrderAuditController/orderAuditList',
        method: 'get',
        params
    })
}
export function orderAudit_batchAudit(data) {
    return fetch({
        url: '/api/erpGoodsOrderAuditController/goodsOrderAudit',
        method: 'post',
        data
    })
}
export function goodsOrderRecovery(data) {
    return fetch({
        url: '/api/erpGoodsOrderAuditController/goodsOrderRecovery',
        method: 'post',
        data
    })
}
// 快递字典
export function sysKdCode_list(params) {
    return fetch({
        url: '/api/sysKdCode/list',
        method: 'get',
        params
    })
}
export function sysKdCode_delete(params) {
    return fetch({
        url: '/api/sysKdCode/delete',
        method: 'delete',
        params
    })
}
export function sysKdCode_addOrUpdate(data) {
    return fetch({
        url: '/api/sysKdCode/addOrUpdate',
        method: 'post',
        data
    })
}
// 操作日志
export function sysLog_list(params) {
    return fetch({
        url: '/api/sysLog/list',
        method: 'get',
        params
    })
}
